<!DOCTYPE html>
<!-- saved from url=(0047)http://shoplist-sandbox.herokuapp.com/shoplist/ -->
<html lang="pt-br"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <title>Projeto</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link rel="stylesheet" href="http://shoplist-sandbox.herokuapp.com/static/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="http://shoplist-sandbox.herokuapp.com/static/css/shoplist.css">
    <link rel="stylesheet" href="http://shoplist-sandbox.herokuapp.com/static/bootstrap/css/bootstrap-responsive.css">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="http://shoplist-sandbox.herokuapp.com/">Cotação de Projetos</a>
          <div class="nav-collapse collapse">
            <p class="navbar-text pull-right">
              
              <a href="http://shoplist-sandbox.herokuapp.com/logout/">Sair</a>
              
            </p>
            <ul class="nav">
              <li class="active" id="id_link_home"><a href="http://shoplist-sandbox.herokuapp.com/shoplist/#">Home</a></li>
              <li><a href="http://shoplist-sandbox.herokuapp.com/shoplist/#about" id="id_link_about">Sobre</a></li>
              <li><a href="http://shoplist-sandbox.herokuapp.com/contact/" id="id_link_contact">Contato</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container">

      

    
    
    <table id="shoplists_table" class="table table-hover">
        <thead>
            <tr>
                <th class="span5">Lista de itens</th>
                <th class="span3" style="text-align: center;">Quantidade</th>
                <th class="span2" style="text-align: center;">Tipo</th>
                <th class="span2" style="text-align: center;">Valor</th>
				<th class="span2" style="text-align: center;">Qtde de Interfaces</th>
            </tr>
        </thead>
        <tbody>
    
            <tr>
                <td class="span6">
                    <input id="listname_12" name="listname_12" type="text" placeholder="Digite o nome da lista…" value="teste2" style="display: none;">
                    <a href="http://shoplist-sandbox.herokuapp.com/shoplist/12/items/">
                        <label id="label_12" style="display: block;">teste2</label>
                    </a>
                </td>
                <td class="span2" style="text-align: center;">Qtde</td>
                <td class="span2" style="text-align: center;">Tipo</td>
				 <td class="span2" style="text-align: center;">Valor</td>
				 <td class="span2" style="text-align: center;">Interfaces</td>
                <td class="span2" style="text-align: center;">
				
                    <div id="edit_buttons_12" style="display: block;">
                        <button class="btn" onclick="editButton(12);"><i class="icon-edit"></i></button>
                        <button class="btn" onclick="removeButton(12);"><i class="icon-trash"></i></button>
                    </div>
                    <div id="update_buttons_12" style="display: none;">
                        <button class="btn" onclick="updateButton(12);"><i class="icon-ok"></i></button>
                        <button class="btn" onclick="cancelButton(12);"><i class="icon-stop"></i></button>
                    </div>
                </td>
				
            </tr>
    
           
    
        </tbody>
    </table>
    



      <hr>

      <footer>
        <p>Copyright © 2013 <a href="https://uoldiveo.com.br"> Uoldiveo </a></p> <p><a href="https://jira.intranet.uol.com.br/jira/secure/ViewProfile.jspa?name=asfreitas">asfreitas </a></p>
      </footer>

    </div> <!-- /container -->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="./Shoplist_files/jquery.min.js" type="text/javascript"></script>
    <script src="./Shoplist_files/bootstrap-modal.js"></script>
    <script src="./Shoplist_files/bootstrap-dropdown.js"></script>
    <script src="./Shoplist_files/bootstrap-transition.js"></script>
    <script src="./Shoplist_files/bootstrap-alert.js"></script>
    <script src="./Shoplist_files/bootstrap-scrollspy.js"></script>
    <script src="./Shoplist_files/bootstrap-tab.js"></script>
    <script src="./Shoplist_files/bootstrap-tooltip.js"></script>
    <script src="./Shoplist_files/bootstrap-popover.js"></script>
    <script src="./Shoplist_files/bootstrap-button.js"></script>
    <script src="./Shoplist_files/bootstrap-collapse.js"></script>
    <script src="./Shoplist_files/bootstrap-carousel.js"></script>
    <script src="./Shoplist_files/bootstrap-typeahead.js"></script>

    <script src="./Shoplist_files/shoplist_admin.js"></script>

    
    
    <script type="text/javascript">
        function editButton(list_id)
        {
            $("#label_"+list_id).hide();
            $("#listname_"+list_id).show();
            $("#edit_buttons_"+list_id).hide();
            $("#update_buttons_"+list_id).show();
            $("#listname_"+list_id).val($("#label_"+list_id).text().trim());
            $("#listname_"+list_id).focus();
        }

        function cancelButton(list_id)
        {
            $("#label_"+list_id).show();
            $("#listname_"+list_id).hide();
            $("#edit_buttons_"+list_id).show();
            $("#update_buttons_"+list_id).hide();
        }

        function updateButton(list_id)
        {
            var shoplist_id = list_id;
            var shoplist_name = $("#listname_"+shoplist_id).val().trim();
            $.ajax(
                {
                    type: "GET",
                    url: "/shoplist/update",
                    data: "id="+shoplist_id+"&name="+shoplist_name,
                    success: function(data){
                        $("#label_"+list_id).text($("#listname_"+shoplist_id).val());
                        $("#label_"+list_id).show();
                        $("#listname_"+list_id).hide();
                        $("#edit_buttons_"+list_id).show();
                        $("#update_buttons_"+list_id).hide();
                    }
                });
        }

        function removeButton(list_id)
        {
            var shoplist_id = list_id;
            if (confirm('Deseja realmente deletar a lista "'+$("#label_"+list_id).text().trim()+'"?')) {
                $.ajax(
                    {
                        type: "GET",
                        url: "/shoplist/remove",
                        data: "id="+shoplist_id,
                        success: function(data){
                            $("#edit_buttons_"+shoplist_id).parent().parent().remove();
                            var row_count = $("#shoplists_table > tbody > tr").length;
                            if (row_count == 0)
                                $("#shoplists_table").remove();
                        }
                    });
            }
        }

        $(document).keyup(function(e)
        {
            if (e.keyCode == 27) {
                $('input[name^="listname_"]').hide();
                $('label[id^="label_"]').show();
                $('div[id^="edit_buttons_"]').show();
                $('div[id^="update_buttons_"]').hide();
            } // ESC pressed
        });
    </script>
    


  

</body></html>